<?php
class  Admin_Model_DbTable_Group  extends  Kieumau_Db_Common
{
	public function init(){
		
		parent::init();
		$this->_name = 'group';
		$this->fieldsPrimary = array('group_parent');
		$this->fieldsLanguage = array('name', 'description');
			
	}
    public function listGroupUser(){
    	try {

			$sql = "SELECT * FROM `".$this->_name."`";
    		$this->_db->setFetchMode ( Zend_Db::FETCH_ASSOC );
    		$result = $this->_db->fetchAll($sql);		
    		return $result;
			
    	} catch ( Exception $ex ) {
    		echo $ex->getMessage ();
    	}
    }
    
	public function getGroupParentUser($idParent=0){
		
		$sql = "SELECT * FROM `".$this->_name."` WHERE `group_parent` = ?";
		$this->_db->setFetchMode ( Zend_Db::FETCH_ASSOC );
		$result = $this->_db->fetchAll($sql, array($idParent));		
		return $result;
		
	}
	
}
